package pre.bookcloud.java21.qoder.todaysign01;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * Student data model class
 * 学生数据模型类
 */
public class Student {
    private String name;        // 学生姓名
    private String stuNo;       // 学生编号
    private int status;         // 签到状态 - 已签到:1; 未签到：0
    private LocalDate signDate; // 签到日期
    private LocalDateTime genDate; // 生成日期

    public Student() {
    }

    public Student(String name, String stuNo, int status, LocalDate signDate, LocalDateTime genDate) {
        this.name = name;
        this.stuNo = stuNo;
        this.status = status;
        this.signDate = signDate;
        this.genDate = genDate;
    }

    // Getter and Setter methods
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getStuNo() {
        return stuNo;
    }

    public void setStuNo(String stuNo) {
        this.stuNo = stuNo;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public LocalDate getSignDate() {
        return signDate;
    }

    public void setSignDate(LocalDate signDate) {
        this.signDate = signDate;
    }

    public LocalDateTime getGenDate() {
        return genDate;
    }

    public void setGenDate(LocalDateTime genDate) {
        this.genDate = genDate;
    }

    /**
     * Get status display text
     * 获取状态显示文本
     */
    public String getStatusText() {
        return status == 1 ? "已签到" : "未签到";
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", stuNo='" + stuNo + '\'' +
                ", status=" + status +
                ", signDate=" + signDate +
                ", genDate=" + genDate +
                '}';
    }
}